package com.example.hibernate.b.association;

import java.util.HashSet;
import java.util.Set;

public class Item {
	
	private Long id;
	private String description;
	private Set<Category> categorise = new HashSet<Category>();
	
	public void addCategory(Category category){
		if(category == null){
			throw new IllegalArgumentException("Null category!");
		}
		category.getItems().add(this);
		categorise.add(category);
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Set<Category> getCategorise() {
		return categorise;
	}
	public void setCategorise(Set<Category> categorise) {
		this.categorise = categorise;
	}
	
	
}
